import React, {Component} from "react";
import {Link} from "react-router-dom"
 
class Index extends Component {
    constructor(props){
        super(props);
        this.state = {  
            list:[
                {cid:123,title:'啦啦啦的个人空间-1'},
                {cid:456,title:'啦啦啦的个人空间-2'},
                {cid:789,title:'啦啦啦的个人空间-3'},
            ]
           }
    }
    render(){
        return (
        <div>
        <h2>Wang.com</h2>
        <ul>
            {
                this.state.list.map((item,index)=>{
                    return(
                        <li key={index}>
                            <Link to={'/list/'+item.cid}>{item.title}-{item.cid}</Link>
                            </li>
                    )
                })
            }
        </ul>
        </div>
        )
    }
}

export default Index;